//
//  goodsmodel.m
//  11213
//
//  Created by student on 16/3/7.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "goodsmodel.h"

@implementation goodsmodel
- (instancetype)initWithDict:(NSDictionary *)dict
{
    self = [super init];
    if (self)
    {
        [self setValuesForKeysWithDictionary:dict];
//        NSLog(@"%@",dict);
    }
    return self;
}

+ (instancetype)gdWithDict:(NSDictionary *)dict
{
    return [[self alloc]initWithDict:dict];
}

+ (NSArray *)goodsList
{
    int i = 0;
    NSString *path = [[NSBundle mainBundle] pathForResource:@"goods" ofType:@"plist"];
    NSArray *arr = [NSArray arrayWithContentsOfFile:path];
    NSMutableArray *marr = [NSMutableArray array];
    for (NSDictionary *tmp in arr)
    {
        goodsmodel *g = [goodsmodel gdWithDict:tmp];
        NSLog(@"gmodel%@:",tmp);
        i ++;
        [marr addObject:g];
    }
    return marr;
}
@end
